<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title></title>
    <link rel="stylesheet" th:href="@{/static/bootstrap/css/bootstrap.min.css}">
    <script th:src="@{/static/js/jquery-3.3.1.min.js}"></script>
    <script th:src="@{/static/bootstrap/js/bootstrap.min.js}"></script>
</head>
<body>
<div th:replace="header::header1"></div>
<div class="col-sm-9 col-sm-offset-3 col-md-11 col-md-offset-1 main">
    <div class="text-right ">
        <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
        <a th:href="@{toAdminHome}">点此返回主页</a>
    </div>
    <div class="text-right ">
        <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
        <a th:href="@{toAdminHome}">点此返回主页</a>
    </div>
    <h2 class="sub-header">我发表的评论</h2>
    <table class="table table-hover">
        <thead>
        <tr>

            <th>评论内容</th>
            <th>发表时间</th>
            <th>评论状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody th:if="${commentList!=null}">
        <div th:each="comment:${commentList.list}">
            <tr>

                <td th:text="${comment.content}"></td>
                <td th:text="${comment.createTime}"></td>
                <td th:text="${comment.state2} !=1 ? '评论已屏蔽':'评论正常'">
                <td>
                    <div class="btn-group">
                        <button type="button"
                                class="btn btn-sm btn-default dropdown-toggle"
                                data-toggle="dropdown" aria-haspopup="true"
                                aria-expanded="false">
                            操作 <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
<!--                            <li><a th:href="@{'getTopicById?id='+${topic.id }}">修改</a></li>-->
                            <li><a th:href="@{'videoPlayById?id='+${comment.videoId}}">查看评论</a></li>
                        </ul>
                    </div>
                </td>
            </tr>
        </div>

        </tbody>
    </table>
    <!-- 分页信息 -->
    <div class="col-md-6">
        当前<span class="label label-default" th:text="${commentList.pageNum }"></span>页
        |总<span class="label label-default" th:text="${commentList.pages }"></span>页
        |有<span class="label label-default" th:text="${commentList.total }"></span>个评论.
    </div>
    <div class="col-md-6">
        <nav aria-label="Page navigation">
            <ul class="pagination" >
                <li><a th:href="@{'getAllCommentByName?pageNum=1&nickname='+${session.user.getUsername()}}">首页</a></li>

                <li th:if="${commentList.hasPreviousPage}">
                    <a th:href="@{'getAllCommentByName?pageNum='+${commentList.pageNum-1}+'&nickname='+${session.user.getUsername()}}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>

<!--                th:each="navigatepageNums:${topicList.navigatepageNums}"-->
<!--                    <li class="active" th:if="${navigatepageNums==topicList.pageNum }">-->
<!--                        <a th:href="@{'getAllTopic?pageNum='+${navigatepageNums}+'&edituser='+${session.user.getUsername()}}" th:text="${navigatepageNums }"></a></li>-->
<!--                    <li th:if="${navigatepageNums!=topicList.pageNum }"><a-->
<!--                            th:href="@{'getAllTopic?pageNum='+${navigatepageNums}+'&edituser='+${session.user.getUsername()}}" th:text="${navigatepageNums }"></a>-->
<!--                    </li>-->

                <li th:if="${commentList.hasNextPage}">
                    <a th:href="@{'getAllCommentByName?pageNum='+${commentList.pageNum+1}+'&nickname='+${session.user.getUsername()}}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>

                <li><a th:href="@{'getAllCommentByName?pageNum='+${commentList.pages }+'&nickname='+${session.user.getUsername()}}">末页</a></li>
            </ul>
        </nav>
    </div>
</div>
</body>
</html>
